class supplementSodium():
    def __init__(self):
        "http://hematol.dxy.cn/article/641916?trace=hot"
        "https://mp.weixin.qq.com/s/p3Ju2eU8u5XGUX_Z0r4UCQ"
        pass

    def calc(self, data):
        """
        计算补充钠
        """
        weight = float(data['weight'])
        sodium = float(data["sodium"])
        if sodium > 135:
            return {"error": "无需补充钠"}
        else:
            result = (142 - sodium) * 0.6 * weight
            if data['sex'] == "女":
                result = result * 0.5
            dict_result = {"result": result}
            if 130 <= sodium <= 135:
                dict_result['type'] = "轻度低钠血症"
            elif 125 <= sodium < 130:
                dict_result['type'] = "中度低钠血症"
            else:
                dict_result['type'] = "重度低钠血症"

            return dict_result


if __name__ == '__main__':
    print(supplementSodium().calc({"weight": "75", "sodium": "128", "sex": "男"}))
